package com.zut.yyzx.controller;


import com.zut.yyzx.pojo.Room;
import com.zut.yyzx.service.RoomService;
import com.zut.yyzx.utils.ResultVo;
import com.zut.yyzx.vo.CwsyBedVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/room")
//"房间管理"
@CrossOrigin
public class RoomController {

    @Autowired
    private RoomService roomService;

    @GetMapping("/findCwsyBedVo")
    //"查询床位示意视图数据"
    public ResultVo<CwsyBedVo> findCwsyBedVo(String floor) throws Exception {
        return roomService.findCwsyBedVo(floor);
    }

    @GetMapping("/listRoom")
    //"查询房间列表"
    public  ResultVo<List<Room>> listRoom(){
        return  ResultVo.ok(roomService.list());
    }

}
